package windows;

import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;


import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JSpinner;

import javax.swing.JPanel;
import javax.swing.JTextArea;

public class ManageRecipeCreate extends JPanel implements ActionListener
{
	/**
	 *
	 */
	private static final long serialVersionUID = 1L;
	private JButton ok;

	private JLabel LblNameRecipe;
	private JLabel LblCodRecipe;
	private JLabel LbltEgg;
	private JLabel LbtFlour;
	private JLabel LblSugar;
	private JLabel LblMilk;
	private JLabel LblColoring;
	private JLabel LblSabor;
	private JLabel LblStraberry;
	private JLabel LblRaisin;
	private JLabel LblAmount;

	private JTextArea TxtNameRecipe;
	private JTextArea TxtCodRecipe;

	private JRadioButton RButtonEgg;
	private JRadioButton RButtonFlour;
	private JRadioButton RButtonSugar;
	private JRadioButton RButtonMilk;
	private JRadioButton RButtonColoring;
	private JRadioButton RButtonSabor;
	private JRadioButton RButtonStraberry;
	private JRadioButton RButtonRaisin;

	private JSpinner JSPEgg;
	private JSpinner JSPFlour;
	private JSpinner JSPSugar;
	private JSpinner JSPMilk;
	private JSpinner JSPColoring;
	private JSpinner JSPSabor;
	private JSpinner JSPstraberry;
	private JSpinner JSPRaisin;


	public ManageRecipeCreate()
	{
		// TODO Auto-generated constructor stub

		setLayout(null);

		RButtonEgg=new JRadioButton();
		RButtonEgg.setBounds(230,155, 40, 20);
		RButtonEgg.addActionListener(this);
		add(RButtonEgg);

		RButtonFlour=new JRadioButton();
		RButtonFlour.setBounds(230,365, 40, 20);
		RButtonFlour.addActionListener(this);
		add(RButtonFlour);

		RButtonSugar=new JRadioButton();
		RButtonSugar.setBounds(230,120, 40, 20);
		RButtonSugar.addActionListener(this);
		add(RButtonSugar);

		RButtonMilk=new JRadioButton();
		RButtonMilk.setBounds(230,225, 40, 20);
		RButtonMilk.addActionListener(this);
		add(RButtonMilk);

		RButtonColoring=new JRadioButton();
		RButtonColoring.setBounds(230,260, 40, 20);
		RButtonColoring.addActionListener(this);
		add(RButtonColoring);

		RButtonSabor=new JRadioButton();
		RButtonSabor.setBounds(230,190, 40, 20);
		RButtonSabor.addActionListener(this);
		add(RButtonSabor);

		RButtonStraberry=new JRadioButton();
		RButtonStraberry.setBounds(230,295, 40, 20);
		RButtonStraberry.addActionListener(this);
		add(RButtonStraberry);

		RButtonRaisin=new JRadioButton();
		RButtonRaisin.setBounds(230,330, 40, 20);
		RButtonRaisin.addActionListener(this);
		add(RButtonRaisin);



		/***************************JButton************<code>true</code>**************************/
		ok = new JButton("Guardar");
		ok.setBounds(170,450, 100, 20);
		ok.addActionListener(this);
		add(ok);


		/*********************************JSpinner***********************************************/

		JSPEgg=new JSpinner();
		JSPEgg.setBounds(300, 155, 40, 25);
		JSPEgg.setEnabled(false);
		add(JSPEgg);

		JSPFlour=new JSpinner();
		JSPFlour.setBounds(300, 365, 40, 25);
		JSPFlour.setEnabled(false);
		add(JSPFlour);

		JSPSugar=new JSpinner();
		JSPSugar.setBounds(300, 120, 40, 25);
		JSPSugar.setEnabled(false);
		add(JSPSugar);

		JSPMilk=new JSpinner();
		JSPMilk.setBounds(300, 225, 40, 25);
		JSPMilk.setEnabled(false);
		add(JSPMilk);

		JSPColoring=new JSpinner();
		JSPColoring.setBounds(300, 260, 40, 25);
		JSPColoring.setEnabled(false);
		add(JSPColoring);

		JSPSabor=new JSpinner();
		JSPSabor.setBounds(300,190, 40, 25);
		JSPSabor.setEnabled(false);
		add(JSPSabor);

		JSPstraberry=new JSpinner();
		JSPstraberry.setBounds(300, 295, 40, 25);
		JSPstraberry.setEnabled(false);
		add(JSPstraberry);

		JSPRaisin=new JSpinner();
		JSPRaisin.setBounds(300, 330, 40, 25);
		JSPRaisin.setEnabled(false);
		add(JSPRaisin);


	    /******************************JLabel**********************************/
		LblAmount=new JLabel ("Cantidad gramos");
		LblAmount.setBounds(280, 85, 165, 25);
		add(LblAmount);

		LblCodRecipe=new JLabel("Codigo Receta:");
		LblCodRecipe.setBounds(50, 15, 150, 25);
		add(LblCodRecipe);

		LblNameRecipe = new JLabel("Nombre Receta:");
		LblNameRecipe.setBounds(50, 50, 150, 25);
		add(LblNameRecipe);

		LbtFlour = new JLabel("Harina:");
		LbtFlour.setBounds(50, 365, 150, 25);
		add(LbtFlour);

		LblSugar = new JLabel("Azucar:");
		LblSugar.setBounds(50, 120, 150, 25);
		add(LblSugar);

		LbltEgg=new JLabel("Huevos");
		LbltEgg.setBounds(50, 155, 150, 25);
		add(LbltEgg);

		LblSabor=new JLabel("Saborizantes");
		LblSabor.setBounds(50, 190, 150, 25);
		add(LblSabor);

		LblMilk=new JLabel("Leche:");
		LblMilk.setBounds(50, 225, 150, 25);
		add(LblMilk);

		LblColoring=new JLabel("Colorantes:");
		LblColoring.setBounds(50, 260, 150, 25);
		add(LblColoring);

		LblStraberry=new JLabel("Fresas:");
		LblStraberry.setBounds(50, 295, 150, 25);
		add(LblStraberry);

		LblRaisin=new JLabel("Uvas Pasas:");
		LblRaisin.setBounds(50, 330, 150, 25);
		add(LblRaisin);

		/****************************JTextArea*************************************/
		TxtNameRecipe = new JTextArea();
		TxtNameRecipe.setBounds(200, 50, 150, 20);
		add(TxtNameRecipe);

		TxtCodRecipe = new JTextArea();
		TxtCodRecipe.setBounds(200, 15, 150, 20);
		TxtCodRecipe.setEditable(false);
		add(TxtCodRecipe);


		/*******************************************************/


		Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
		setBounds((screenSize.width-664)/2, (screenSize.height-456)/2, 670, 310);
	}
	


	public void actionPerformed(ActionEvent e)
	{

		if(e.getSource()==ok)
		{
		
		}
		if(e.getSource()==RButtonColoring)
		{
			JSPColoring.setEnabled(true);	
		}
		if(e.getSource()==RButtonEgg)
		{
			JSPEgg.setEnabled(true);	
		}
		if(e.getSource()==RButtonFlour)
		{
		JSPFlour.setEnabled(true);	
		}
		if(e.getSource()==RButtonMilk)
		{
		JSPMilk.setEnabled(true);	
		}
		if(e.getSource()==RButtonRaisin)
		{
		JSPRaisin.setEnabled(true);	
		}
		if(e.getSource()==RButtonSabor)
		{
		JSPSabor.setEnabled(true);	
		}
		if(e.getSource()==RButtonStraberry)
		{
		JSPstraberry.setEnabled(true);	
		}
		if(e.getSource()==RButtonSugar)
		{
		JSPSugar.setEnabled(true);	
		}
		

		
	}
	
}